package cn.maiyar.common.annotation;

import cn.maiyar.common.serializer.BigDecimalSerialize;
import com.fasterxml.jackson.annotation.JacksonAnnotationsInside;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;

import javax.validation.Payload;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
@JacksonAnnotationsInside
@JsonSerialize(using = BigDecimalSerialize.class)
public @interface JacksonBigDecimal {

    String pattern() default "#0.0000";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};
}